﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace PracaInz_v0
{
    class BottomBarInfo : INotifyPropertyChanged
    {
        BottomBarInfo() { }

        int _dataViewRowsCount = 0;
        string _executionTimeInfo;

        public string ExecutionTimeInfo
        {
            get { return this._executionTimeInfo; }
            set
            {
                this._executionTimeInfo = value;
                OnPropertyChanged("ExecutionTimeInfo");
            }
        }

        public int DataViewRowsCount
        {
            get { return this._dataViewRowsCount; }
            set
            {
                this._dataViewRowsCount = value;
                OnPropertyChanged("DataViewRowsCount");
            }
        }

        #region Instance

        private static BottomBarInfo _instance;
        private static object syncRoot = new Object();

        public static BottomBarInfo Instance
        {
            get
            {
                if (_instance == null)
                {
                    lock (syncRoot)
                    {
                        if (_instance == null)
                            _instance = new BottomBarInfo();
                    }
                }
                return _instance;
            }
        }

        #endregion

        public event PropertyChangedEventHandler PropertyChanged = null;

        virtual protected void OnPropertyChanged(string propName)
        {
            if (PropertyChanged != null)
                PropertyChanged(this, new PropertyChangedEventArgs(propName));
        }

    }
}
